package com.doudou.eurekaProvider.controller;

import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author mazh
 * @date 2021-12-02 22:23
 */
@RestController
public class HelloController {
    private static final Logger logger = LoggerFactory.getLogger(HelloController.class);

    @GetMapping("/hello")
    public String hello(@RequestParam Map<String, Object> params){
        logger.info("hello方法入参：{}",JSON.toJSONString(params));

        return String.format("hello,%s!",params.get("name"));
    }
    @GetMapping("/helloMsg")
    public String hello(){
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return String.format("hello,%s!","Eureka");
    }
}
